package com.tinysoft.gameframework;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;

public class MainActivity extends Activity {

    private MainView mainView;

	@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        //setContentView(R.layout.main_view);
        mainView = new MainView(this);
        setContentView(mainView);
        
		int screenWidth = getWindowManager().getDefaultDisplay().getWidth();
        int screenHeight = getWindowManager().getDefaultDisplay().getHeight();
        Log.i("MainActivity", "x=" + screenWidth + " y:" + screenHeight);
        
        //mainView = (MainView)findViewById(R.id.main_view);
        mainView.init(screenWidth, screenHeight, this);
    }

    @Override
    public void onStart() {
    	super.onStart();
    	Log.i("MainActivity", "onStart");
    }
    
    @Override
    public void onResume() {
    	super.onResume();
    	mainView.stopDrawing(false);
    	Log.i("MainActivity", "onResume");
    }
    
    @Override
    public void onPause() {
    	super.onPause();
    	mainView.stopDrawing(true);
    	Log.i("MainActivity", "onPause");
    }

    @Override
    public void onStop() {
    	super.onStop();
    	Log.i("MainActivity", "onStop");
    }

    @Override
    public void onDestroy() {
    	super.onDestroy();
    	Log.i("MainActivity", "onDestory");
    }

}
